import { createRouter, createWebHistory } from 'vue-router'
import HomeView from '../views/HomeView.vue'
const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path: '/home',
      name: 'home',
      component: HomeView,
      children: [
        {
          //个人中心
          path: '/IndividualCenter',
          name: 'IndividualCenter',
          component: () => import('../views/IndividualCenter.vue')
        },
        {
          //公众监督员提交反馈
          path: '/reportView',
          name: 'reportView',
          component: () => import('../components/supervisor/reportView.vue')
        },
        {
          //自己的反馈信息列表
          path: '/HistoryReportList',
          name: 'HistoryReportList',
          component: () => import('../components/supervisor/HistoryReportList.vue')
        },
        {
          path: '/feedbackDetail/:id',
          name: 'feedbackDetail',
          component: () => import('../views/DetailFeedbackView.vue'),
          props: true
        },
        {
          path: '/airQualityDetail/:id',
          name: 'airQualityDetail',
          component: () => import('../views/DetailAirQuaility.vue'),
          props: true
        },
        {
          //查看个人信息
          path: '/PersonalInfo',
          name: 'PersonalInfo',
          component: () => import('../views/PersonalInfo.vue')
        },
        {
          //修改登录密码
          path: '/UpdatePsw',
          name: 'UpdatePsw',
          component: () => import('../views/UpdatePsw.vue')
        },
        {
          //更换头像 × 👇
          path: '/UploadAvatar',
          name: 'UploadAvatar',
          component: () => import('../views/UploadAvatar.vue')
        },
        {
          //网格员
          path: '/MonitorTaskView',
          name: 'MonitorTaskView',
          component: () => import('../components/gridman/MonitorTaskView.vue')
        },
        {
          //网格员历史检测列表
          path: '/HistoryTaskList',
          name: 'HistoryTaskList',
          component: () => import('../components/gridman/HistoryTaskList.vue')
        },
        {
          //反馈信息列表
          path: '/FeedbackView',
          name: 'FeedbackView',
          component: () => import('../components/feedbackList/FeedbackTable.vue')
        },
        {
          //确认信息列表
          path: '/ComfirmView',
          name: 'ComfirmView',
          component: () => import('../components/confirmAqi/ComfirmTable.vue')
        },
        {
          path: '/ChinaCharts',
          name: 'ChinaCharts',
          component: () => import('../components/chart/ChinaCharts.vue')
        },
        {
          //省分组统计
          path: '/ProvinceGroupView',
          name: 'ProvinceGroupView',
          component: () => import('../components/chart/ProGroupCharts.vue')
        },
        {
          //分布统计
          path: '/AQIDistribution',
          name: 'AQIDistribution',
          component: () => import('../components/chart/DistributeCharts.vue')
        },
        {
          //趋势统计
          path: '/AQITrendView',
          name: 'AQITrendView',
          component: () => import('../components/chart/TrendCharts.vue')
        },
        {
          path: '/OtherDataView',
          name: 'OtherDataView',
          component: () => import('../components/statisticalData/OtherDataView.vue')
        },
        {
          //分布饼状图
          path: '/DistributeCharts',
          name: 'DistributeCharts',
          component: () => import('../components/chart/DistributeCharts.vue')
        },
        {
          //趋势折线图
          path: '/TrendCharts',
          name: 'TrendCharts',
          component: () => import('../components/chart/TrendCharts.vue')
        },
        {
          //省分组柱状图
          path: '/ProGroupCharts',
          name: 'ProGroupCharts',
          component: () => import('../components/chart/ProGroupCharts.vue')
        },
        {
          //管理监督员
          path: '/SupervisorManage',
          name: 'SupervisorManage',
          component: () => import('../components/userManage/SupervisorManage.vue')
        },
        {
          //管理网格员
          path: '/GridmanManage',
          name: 'GridmanManage',
          component: () => import('../components/userManage/GridmanManage.vue')
        },
        {
          path: '/UploadAvatarCopy',
          name: 'UploadAvatarCopy',
          component: () => import('../views/UploadAvatarCopy.vue')
        }
      ]
    },
    {
      path: '/',
      name: 'login',
      component: () => import('../views/loginView.vue')
    },
    {
      path: '/register',
      name: 'register',
      component: () => import('../views/registerView.vue')
    },
    {
      path: '/registerCopy',
      name: 'registerCopy',
      component: () => import('../views/registerCopy.vue')
    },
    {
      path: '/About',
      name: 'About',
      component: () => import('../views/AboutView.vue')
    }
  ]
})

export default router
